package com.prs.crm.service;

import java.io.Serializable;

import org.courser.service.ServiceSupport;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;

import com.prs.crm.domain.BaseEntity;

public interface BaseService<K extends BaseEntity> extends ServiceSupport<K>{
	
	
	DetachedCriteria createQuery(Class cls);
	
	/**
	 * 批量删除
	 * @param cls
	 * @param ids
	 * @return
	 */
	int batchRemove(java.io.Serializable[] ids);
	/**
	 * 草稿
	 * @param entity
	 */
	void draft(K entity);
	
	/**
	 * 回收
	 * @param entity
	 */
	void trash(K entity);
	
	/**
	 * 提交
	 * @param entity
	 */
	void submit(K entity);
	
	/**
	 * 批量草稿
	 * @param ids
	 * @return
	 */
	int batchDraft(Serializable[] ids);
	 
	/**
	 * 批量回收
	 */
	int batchTrash(Serializable[] ids);
	
	/**
	 * 批量提交
	 * @param ids
	 * @return
	 */
	int batchSubmit(Serializable[] ids);
	
	/**
	 * 草稿分页
	 * @param detachCriteria
	 * @param page
	 * @return
	 */
	PaginationSupport pageQueryDraft(final DetachedCriteria detachCriteria, final PaginationSupport page);
	
	/**
	 * 正常分页
	 * @param detachCriteria
	 * @param page
	 * @return
	 */
	PaginationSupport pageQueryFormal(final DetachedCriteria detachCriteria, final PaginationSupport page);
	
	/**
	 * 回收分页
	 * @param detachCriteria
	 * @param page
	 * @return
	 */
	PaginationSupport pageQueryTrash(final DetachedCriteria detachCriteria, final PaginationSupport page);
	
	
}
